package com.pai.dao.LeaveTicket;

import com.pai.entity.LeaveTicket;

import java.sql.Connection;
import java.util.Date;
import java.util.List;

/**
 * 请假单dao
 */
public interface LeaveTicketDao {
    /**
     * 获取列表
     * @param connection
     * @return
     * @throws Exception
     */
    public List<LeaveTicket> getList(Connection connection) throws Exception;

    /**
     * 获取列表
     * @param connection
     * @param claId  班级id
     * @param starDate  请假开始时间
     * @param endDate  请假结束时间
     * @return
     * @throws Exception
     */
    public List<LeaveTicket> getList(Connection connection, String claId, Date starDate, Date endDate) throws Exception;

    /**
     * 获取请假单列表（学生）
     * @param connection
     * @param stuId  学生id
     * @return
     * @throws Exception
     */
    public List<LeaveTicket> getListStu(Connection connection, String stuId) throws Exception;

    /**
     * 获取请假单列表（辅导员）
     * @param connection
     * @param colId  辅导员id
     * @return
     * @throws Exception
     */
    public List<LeaveTicket> getListCol(Connection connection, String colId) throws Exception;





    /**
     * 根据部门类型获取部门列表
     * @param connection
     * @param depType
     * @return
     * @throws Exception
     */
    public List<LeaveTicket> getList(Connection connection, String depType) throws Exception;

    /**
     * 获取班级部门列表
     * @param connection
     * @param depId 父级部门id
     * @return
     * @throws Exception
     */
    public List<LeaveTicket> getDepClassList(Connection connection, String depId) throws Exception;

    /**
     * 获取列表数量
     * @param connection
     * @param date  日期
     * @return
     * @throws Exception
     */
    public int getListCount(Connection connection, Date date) throws Exception;

    /**
     * 获取项详情
     * @param connection
     * @param id
     * @return
     * @throws Exception
     */
    public LeaveTicket getItemDetail(Connection connection, String id) throws Exception;


    /**
     * 获取项
     * @param connection
     * @param depName  部门名称
     * @param depType  部门类型
     * @return
     * @throws Exception
     */
    public LeaveTicket getItemDetail(Connection connection, String depName, String depType) throws Exception;


    /**
     * 新增
     * @param connection
     * @param item
     * @return
     * @throws Exception
     */
    public int add(Connection connection, LeaveTicket item) throws Exception;




    /**
     * 更新
     * @param connection
     * @param item
     * @return
     * @throws Exception
     */
    public int update(Connection connection, LeaveTicket item) throws Exception;

    /**
     * 删除
     * @param connection
     * @param id
     * @return
     * @throws Exception
     */
    public int delete(Connection connection, String id) throws Exception;
}
